home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 6 / FM Towns Free Software Collection 6.iso / ms_dos / mos / source / mos104.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-08  |  523 b   |  23 lines

  1.  
  2. /*
  3.  *
  4.  *    MOS104 : マウスカ-ソル位置とボタンの読み取り
  5.  *
  6.  */
  7.  
  8. #include <stdio.h>
  9. #include <dos.h>
  10.  
  11. unsigned int MOS_read_cursor(unsigned char *status,signed int *horizon,signed int *vertical) {
  12.    union  REGS  inregs, outregs;
  13.    struct SREGS segregs;
  14.  
  15.    segread(&segregs);
  16.    inregs.x.ax=0x0300;
  17.    int86x(0x99,&inregs,&outregs,&segregs);
  18.    *status=(unsigned char)outregs.h.ch;
  19.    *horizon=(signed int)outregs.x.dx;
  20.    *vertical=(signed int)outregs.x.bx;
  21.    return (unsigned int)outregs.h.ah;
  22. }
  23.